package com.nxu.admin.mapper;

import com.nxu.admin.bean.City;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

/**
 * Author wen
 * Date 2021-12-04
 */
@Mapper
public interface CityMapper {

    @Select("select * from city where id=#{id}")
    public City getCityById(Long id);

    @Insert("insert into city(name,state,country) values(#{name},#{state},#{country})")
    @Options(useGeneratedKeys = true,keyProperty = "id")
    public void insert(City city);
}
